package com.jjb.saas.gen.controller;

import lombok.Data;

import java.io.Serializable;
import java.util.List;
import java.util.Map;

/**
 * @author WGG
 * @date 2024/1/16 11:16
 */
@Data
public class PdmanJsonCmd implements Serializable{
    private static final long serialVersionUID = 1L;
    private List<Module> modules;
    private DataTypeDomain dataTypeDomains;

    @Data
    public static class Module{
        private String name;
        private String chnname;
        private List<ModuleEntitie> entities;
        private List<ModuleAssociations> associations;
    }

    @Data
    public static class ModuleEntitie{
        private String title;
        private List<ModuleEntitiesField> fields;
        private String chnname;
        private String remark;
    }

    @Data
    public static class ModuleEntitiesField{
        private String name;
        private String type;
        private String remark;
        private String chnname;
        private boolean pk;
        private boolean notNull;
    }

    @Data
    public static class ModuleAssociations{
        private String relation;
        private ModuleAssociationsFromTo from;
        private ModuleAssociationsFromTo to;
    }

    @Data
    public static class ModuleAssociationsFromTo{
        private String entity;
        private String field;
    }

    @Data
    public static class DataTypeDomain{
        private List<DataTypeDomainDatatype> datatype;
    }
    @Data
    public static class DataTypeDomainDatatype{
        private String name;
        private String code;
        private Map apply;
    }
    @Data
    public static class DataTypeDomainDatatypeApply{
        private Map java;
        private Map mysql;
    }
    @Data
    public static class DataTypeDomainDatatypeApplyType{
        private String type;
    }
}
